Optimal. Leaf size=35 \[ \frac{b x}{a^2+b^2}-\frac{a \log (a \cos (x)+b \sin (x))}{a^2+b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0566863, antiderivative size = 35, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3097, 3133} \[ \frac{b x}{a^2+b^2}-\frac{a \log (a \cos (x)+b \sin (x))}{a^2+b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3097
Rule 3133
Rubi steps
\begin{align*} \int \frac{\sin (x)}{a \cos (x)+b \sin (x)} \, dx &=\frac{b x}{a^2+b^2}-\frac{a \int \frac{b \cos (x)-a \sin (x)}{a \cos (x)+b \sin (x)} \, dx}{a^2+b^2}\\ &=\frac{b x}{a^2+b^2}-\frac{a \log (a \cos (x)+b \sin (x))}{a^2+b^2}\\ \end{align*}
Mathematica [C] time = 0.0550763, size = 47, normalized size = 1.34 \[ \frac{2 x (b-i a)-a \log \left ((a \cos (x)+b \sin (x))^2\right )+2 i a \tan ^{-1}(\tan (x))}{2 \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.058, size = 54, normalized size = 1.5 \begin{align*} -{\frac{a\ln \left ( a+b\tan \left ( x \right ) \right ) }{{a}^{2}+{b}^{2}}}+{\frac{a\ln \left ( \left ( \tan \left ( x \right ) \right ) ^{2}+1 \right ) }{2\,{a}^{2}+2\,{b}^{2}}}+{\frac{b\arctan \left ( \tan \left ( x \right ) \right ) }{{a}^{2}+{b}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.71766, size = 119, normalized size = 3.4 \begin{align*} \frac{2 \, b \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a^{2} + b^{2}} - \frac{a \log \left (-a - \frac{2 \, b \sin \left (x\right )}{\cos \left (x\right ) + 1} + \frac{a \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}}\right )}{a^{2} + b^{2}} + \frac{a \log \left (\frac{\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1\right )}{a^{2} + b^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.501445, size = 112, normalized size = 3.2 \begin{align*} \frac{2 \, b x - a \log \left (2 \, a b \cos \left (x\right ) \sin \left (x\right ) +{\left (a^{2} - b^{2}\right )} \cos \left (x\right )^{2} + b^{2}\right )}{2 \,{\left (a^{2} + b^{2}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.18595, size = 74, normalized size = 2.11 \begin{align*} -\frac{a b \log \left ({\left | b \tan \left (x\right ) + a \right |}\right )}{a^{2} b + b^{3}} + \frac{b x}{a^{2} + b^{2}} + \frac{a \log \left (\tan \left (x\right )^{2} + 1\right )}{2 \,{\left (a^{2} + b^{2}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]